home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
DDJMAG
/
DDJ9212.ZIP
/
strupro.asc
< prev
next >
Wrap
Text File
|
1992-11-30
|
2KB
|
55 lines
_STRUCTURED PROGRAMMING_
by Jeff Duntemann
[LISTING ONE]
PROCEDURE TMortgageView.ExtraPrincipalRange;
VAR
ExtraRangeDialog : PDialog;
ExtraPrincipalData : ExtraPrincipalRangeDialogData;
FromPaymentLine,
ToPaymentLine,
DollarsInputLine : PFinputLine;
R : TRect;
Control : Word;
View : PView;
BEGIN
{ Instantiate the resource-based EXTRA_RANGE dialog box from MORTGAGE.BRS:}
ExtraRangeDialog := PDialog(bAppResFile.Get('EXTRA_RANGE'));
{ Create and shoehorn the three FInputLine controls: }
R.Assign(0,0,0,0);
DollarsInputLine := New(PFinputLine,Init(R,8,DRealSet,DReal,2));
View := bShoeHorn(ExtraRangeDialog,DollarsInputLine);
ToPaymentLine := New(PFInputLine,Init(R,3,DUnSignedSet,DInteger,0));
View := bShoeHorn(ExtraRangeDialog,ToPaymentLine);
FromPaymentLine := New(PFInputLine,Init(R,3,DUnSignedSet,DInteger,0));
View := bShoeHorn(ExtraRangeDialog,FromPaymentLine);
{ Set the default values for the dialog through SetData: }
ExtraPrincipalData.FromPaymentNumber := 0;
ExtraPrincipalData.ToPaymentNumber := 0;
ExtraPrincipalData.ExtraDollars := 0.00;
ExtraRangeDialog^.SetData(ExtraPrincipalData);
Control := Desktop^.ExecView(ExtraRangeDialog);
IF Control <> cmCancel THEN { Update the active mortgage window: }
BEGIN
{ Get data from the extra principal dialog: }
ExtraRangeDialog^.GetData(ExtraPrincipalData);
WorkingBox^.Show;
WITH ExtraPrincipalData DO
Mortgage.RangeExtraPrincipal(FromPaymentNumber,
ToPaymentNumber,
ExtraDollars);
WorkingBox^.Hide;
Redraw; { Redraw the mortgage window }
END;
Dispose(ExtraRangeDialog,Done);
END;